import { RESPONESTATUS } from "../enum";

//公共返回失败
export class CommonError extends Error  {
    msg: string;
    code: number;
    data: any;
    constructor(msg: string = "", code = RESPONESTATUS.ERROR) {
        super();
        this.msg = msg;
        this.code = code;
    }
}
//公共成功响应体
export class CommonRes  {
    msg: string;
    code: number;
    data: any;
    constructor(data = {}, msg: string = "操作成功", code = RESPONESTATUS.SUCCESS) {
        this.msg = msg;
        this.code = code;
        this.data = data;
    }
}